package com.neuedu.ylbx.controller;

import com.neuedu.ylbx.service.InpatientDiagnosisService;
import com.neuedu.ylbx.utils.ResultVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

/**
 * @version V1.0
 * @author: xianzhen
 * @date: 2025/7/9
 */

@RestController
@RequestMapping("/inpatientDiagnosis")
@Tag(name = "住院诊断控制器")
@CrossOrigin
public class InpatientDiagnosisController {
    @Autowired
    InpatientDiagnosisService inpatientDiagnosisService;

    @GetMapping("/getInpatientDiagnosis")
    @Operation(summary = "获取诊疗项目列表")
    public ResultVo<List<InpatientDiagnosisService>> getInpatientDiagnosis(String patientId) throws Exception{
        return inpatientDiagnosisService.list(patientId);
    }

    @PostMapping("/addInpatientDiagnosis")
    @Operation(summary = "添加诊疗项目医嘱")
    public ResultVo addInpatientDiagnosis(String patientId, Date orderTime, String doctorOrder, Integer status) throws Exception{
        return inpatientDiagnosisService.add(patientId, orderTime, doctorOrder, status);
    }

    @PostMapping("/queryInpatientDiagnosisVo")
    @Operation(summary = "查询诊疗项目")
    public ResultVo queryInpatientDiagnosisVo(String patientId, String diagnosisId) throws Exception{
        return inpatientDiagnosisService.queryInpatientDiagnosisVo(patientId, diagnosisId);
    }

}
